/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DataBase;

import java.sql.Connection;
import oracle.jdbc.pool.OracleDataSource;

/**
 *
 * @author ZempoX
 */
public class Koneksi {

    public static Connection open() {
        Connection con = null;
        String url = "jdbc:oracle:thin:@172.23.9.185:1521:orcl";
        String username = "mhs115314008"; // gantikan dengan username anda
        String password = "mhs115314008";
        OracleDataSource ds;
        try {
            ds = new OracleDataSource();
            ds.setURL(url);
            con = ds.getConnection(username, password);
            System.out.println("Koneksi is OK");
        } catch (Exception e) {
            System.out.println("error: " + e.getMessage());
        }
        return con;
    }
}
